<?php
	$this->menu=array(
		array('label'=>'Manage Label', 'url'=>array('index')),
		array('label'=>'Create Label', 'url'=>array('create')),
	);
?>

<div id="divListCat">
<?php

$this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'catproduct-grid',
	'dataProvider'=>$model->getChildren(),
	#'ajaxUpdate'	=>	'divListCat',
 	'columns'=>array(
		'id',
		array(
			'urlExpression'	=>	'Yii::app()->controller->createUrl("view",array("id"=>$data->primaryKey))',
			'labelExpression'	=>	'$data->name',
			#'name'			=>	'name',
			'class'			=>	'CLinkColumn',
		),
		'name_en',
		'index',
		array(
			'class'=>'CButtonColumn',
			'buttons'	=>	array(
				'up'	=>	array(
					'label'	=>	'up',
					'url'	=>	'Yii::app()->controller->createUrl("up",array("id"=>$data->id))',
//					'imageUrl'	=>	$this->module->assetsUrl . '/images/icon_up.jpg',
					'options'	=>	array(
						'class'	=>	'ajax',
					),
				),
				'down'	=>	array(
					'label'	=>	'down',
					'url'	=>	'Yii::app()->controller->createUrl("down",array("id"=>$data->id))',
//					'imageUrl'	=>	$this->module->assetsUrl . '/images/icon_down.jpg',
					'options'	=>	array(
						'class'	=>	'ajax',
					),
				),
			),
			'template'	=>	'{up} {down} {view}{update}{delete}'		,
			'htmlOptions'	=>	array(
				'width'	=>	'120px',
			),
//			'afterDelete'	=>	'function(link, success, data) { ActMsg.showMessage(data); }',
		),
	),
)); ?>
</div>





<script language="JavaScript">
<!--
	jQuery(function($) {
	jQuery('#catproduct-grid a.ajax').live('click',function() {

	var th=this;
	$.fn.yiiGridView.update('catproduct-grid', {
		type:'POST',
		url:$(this).attr('href'),
		success:function(data) {
//			ActMsg.showMessage(data);
			$.fn.yiiGridView.update('catproduct-grid');
		},
	});
	return false;
})});
//-->
</script>
